<template>
  <div @click="back" class="back-wrap">
    <el-icon class="back-icon"><Back /></el-icon>
    <span class=""></span>
    <div class="title">{{props.backOption.title}}</div>
  </div>
</template>
<script setup>
import { Back } from "@element-plus/icons-vue";
import { useRouter } from 'vue-router';
const router = useRouter();
const props = defineProps({
  backOption: {
    type: Object,
    default: () => ({}),
  },
});
const back = () => {
  if (props.backOption.route) {
    router.push(props.backOption.route);
    return;
  }
  router.go(-1)
}
</script>
<style lang="scss">
.back-wrap {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid rgba(34,36,38,.15);
  align-items: center;
  color: rgb(127, 141, 154);
  .title {
    &::before{
      content: " ";
      display: inline-block;
      width: 1px!important;
      height: 16px;
      background-color: rgb(204, 204, 204);
      margin: 0 20px;
      position: relative;
      top: 3px;
    }
  }
  .back-icon {
    width: 24px;
    &:hover {
      cursor: pointer;
    }
  svg {
    width: 24px;
    height: 24px;
    color: rgb(127, 141, 154)
  }
}
}

</style>
